<template id="newlist">

<div  class="top11">

        <!-- <mt-header title="新闻资讯">
          <mt-button  icon="back" slot="left"><router-link to="/home">返回</router-link></mt-button>
             <mt-button icon="more" slot="right"></mt-button>
            </mt-header> -->
        

    <!-- <ul class="mui-table-view mui-table-view-chevron" >
		<li class="mui-table-view-cell mui-media" v-for=" item in newlist " :key="item.stat">
					<router-link to="/newinfo" class="mui-navigate-right" href="javascript:;">
						<img class="mui-media-object mui-pull-left" >
						<div class="mui-media-body">
							工作环境
							<p class='mui-ellipsis' >{{item.title}}</p>
							<p class='mui-ellipsis' >{烤炉模式的城，到黄昏，如同打翻的调色盘一般}</p> 
                            <span id="time">{{time | formatTime}}</span>
                            <span id="good">点赞次数:0</span>
						</div>
					</router-link>
				</li> -->



				<ul class="mui-table-view mui-table-view-chevron" >
		<li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
					<router-link to="/newinfo" class="mui-navigate-right" href="javascript:;">
					<img class="mui-media-object mui-pull-left" :src="item.img_url" >
						<div class="mui-media-body" id="text123">
							{{item.title}}
							<p class='mui-ellipsis' >能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
							<!-- <p class='mui-ellipsis' >{烤炉模式的城，到黄昏，如同打翻的调色盘一般}</p> -->
                            <span id="time">{{time | formatTime}}</span>
                            <span id="good">点赞次数:{{item.click}}</span>
						</div>
					</router-link>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a class='mui-navigate-right' @click="getnewlist1()" href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../images/6.jpg">
						<div class="mui-media-body">
							远眺
							<p class='mui-ellipsis'  >静静的看这个世界，最后终于疯了</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<router-link   to="/newinfo" class="mui-navigate-right"  href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../images/7.jpg">
						<div class="mui-media-body">
							幸福
							<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</router-link>
				</li>
			</ul>

            <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/3.jpg">
						<div class="mui-media-body">
							远眺
							<p class='mui-ellipsis'>静静的看这个世界，最后终于疯了</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/6.jpg">
						<div class="mui-media-body">
							幸福
							<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/7.jpg">
						<div class="mui-media-body">
							木屋
							<p class='mui-ellipsis'>想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
						</div>
					</a>
				</li>
			</ul>

            <ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell mui-media">
					<a class="mui-navigate-right" href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../images/3.jpg">
						<div class="mui-media-body">
							CBD
							<p class='mui-ellipsis' >烤炉模式的城，到黄昏，如同打翻的调色盘一般.</p>
                            
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a class='mui-navigate-right' href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../images/6.jpg">
						<div class="mui-media-body">
							远眺
							<p class='mui-ellipsis'>静静的看这个世界，最后终于疯了</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a class="mui-navigate-right"  href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="../images/7.jpg">
						<div class="mui-media-body">
							幸福
							<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
			</ul>


             <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/3.jpg">
						<div class="mui-media-body">
							远眺
							<p class='mui-ellipsis'>静静的看这个世界，最后终于疯了</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/6.jpg">
						<div class="mui-media-body">
							幸福
							<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/7.jpg">
						<div class="mui-media-body">
							木屋
							<p class='mui-ellipsis'>想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
						</div>
					</a>
				</li>
			</ul> 
			 <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/3.jpg">
						<div class="mui-media-body">
							远眺
							<p class='mui-ellipsis'>静静的看这个世界，最后终于疯了</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/6.jpg">
						<div class="mui-media-body">
							幸福
							<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/7.jpg">
						<div class="mui-media-body">
							木屋
							<p class='mui-ellipsis'>想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
						</div>
					</a>
				</li>
			</ul> 
			 <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/3.jpg">
						<div class="mui-media-body">
							远眺
							<p class='mui-ellipsis'>静静的看这个世界，最后终于疯了</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/6.jpg">
						<div class="mui-media-body">
							幸福
							<p class='mui-ellipsis'>能和心爱的人一起睡觉，是件幸福的事情；可是，打呼噜怎么办？</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-right" src="../images/7.jpg">
						<div class="mui-media-body">
							木屋
							<p class='mui-ellipsis'>想要这样一间小木屋，夏天挫冰吃瓜，冬天围炉取暖.</p>
						</div>
					</a>
				</li>
			</ul> 
</div>

</template>


<style>
.top11{
    padding-top: 40px;
	padding-bottom: 50px;
}

#time{
    color:red;
}
#good{
    color: aqua;
}
</style>
  
<script>

//  $(function(){
//                             $("#but").click(function(){
//                                     $.ajax({
//                                           url:'../API/新闻.json',
//                                           type:'get', 
//                                           data: '',
//                                           dataType: 'json',
//                                           // success: result =>{ alert(result.message) }

//                                     }).then(
//                                           function(data){
//                                                 alert(data.title)
//                                           }
//                                     )
//                             });
//                         });

// 	Vue.filter('dataformat' , function(str){
//   //replace 中的可以写字符串 也可以写正则 
// var dt= new Date(str)        //根据给定的字符串 得到一个特定的时间
// var y =dt.getFullYear()
// var x=dt.getMonth() + 1
// var z =dt.getDate()

// var h = dt.getHours()
// var m = dt.getMinutes()
// var s = dt.getSeconds()
// return  ` ${y}-${x}-${z} ${h}:${m}:${s}`
// })

import {Toast} from 'mint-ui'
export default  {     //向外暴露成员  
        data(){
            return{
					newlist : []  ,   //新闻信息  默认是一个空数组
					title: '',
					id:'',
					img_url: '',
					stat: '',
					time: new Date()
            }
		},
		filters:{
			"formatTime":function(str){
             var dt= new Date(str)        //根据给定的字符串 得到一个特定的时间
var y =dt.getFullYear()
var x=dt.getMonth() + 1
var z =dt.getDate()

var h = dt.getHours()
var m = dt.getMinutes()
var s = dt.getSeconds()
return  ` ${y}-${x}-${z} ${h}:${m}:${s}`
           }

		},
		created(){
		 this.getnewlist();
		},
            methods:{
                    getnewlist(){
						
						$.ajax({
                            url:'http://www.yjw.com/WEBPACK1/%E9%A1%B9%E7%9B%AE/%E5%90%8E%E5%8F%B0/newlist.json',
                            type:'get',
							dataType:'jsonp',
							crossDomain: true,  
							data:'' ,
							success: function(result){
									if(result.body.status === 0){
								this.newlist=result.body.message
								 $("#text123").html(result.message.title);
									   } else {
										   Toast('获取失败')
									   }
							}

						 })

						// this.$http.get("http://www.yjw.com/WEBPACK1/%E9%A1%B9%E7%9B%AE/%E5%90%8E%E5%8F%B0/newlist.json")
						//  .then( 
                        //         result=>{ 
						// 			if(result.body.status === 0){
						// 		this.newlist=result.body.message
						// 			   } else {
						// 				   Toast('获取失败')
						// 			   }
						// 	  }
							 
						//   )
                           
                            // function(data){
                            //     this.newlist=data.img_url
                            // }
						 
						


						 
                    },

                     getnewlist1(){
						 Toast("获取失败!");
                        
                    }
                       
            }  
}
</script>
